package com.bs.resa.web;

import com.bs.resa.service.DeptService;
import com.bs.resa.service.ProjectService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author lin
 * @date 2019/4/4 14:14
 */
@RestController
public class DeptController {
@Autowired
DeptService deptService;
@Autowired
 ProjectService projectService;


    @ApiOperation(value = "部门员工zTree",notes = "GET")
    @RequestMapping(value = "project/deptUser.do",method = RequestMethod.GET)
    public Object queryDeptUser(){
        Map<String,Object> map=new HashMap<>();
        List<Map<String,Object>> deptAll=deptService.queryAll();
        System.out.println(deptAll);
        map.put("data",deptAll);
        return map ;
    }

    @ApiOperation(value = "项目参与人员",notes = "POST")
    @RequestMapping(value = "project/users.do",method = RequestMethod.POST)
    public Object queryProjectUser(){
        Map<String,Object> map=projectService.queryUserProject();
        System.out.println("参与人员：");
        System.out.println(map);
        return map ;
    }
}
